package com.bootcamp.s2_0922.ds._1004;

import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

/**
 * @program: myClassCode
 * @description:
 * @author: Keyu Li
 * @create: 2021-10-04 16:09
 **/

public class Demo2_Properties {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();
        properties.put("zs", "10");
        properties.setProperty("zss","12");
        properties.put(new User(1,"zs",1.5),1);

//        FileWriter writer = new FileWriter("a.properties");
//        properties.store(writer, "123");

        FileOutputStream outputStream = new FileOutputStream("a.xml");
        properties.storeToXML(outputStream,"234");
        System.out.println(properties);


    }
}

class User{
    int age;
    String name;
    double price;

    public User(int age, String name, double price) {
        this.age = age;
        this.name = name;
        this.price = price;
    }
}
